package button;

import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Point2D;

import loading.ImageLoader;
import math.Vector2D;

public class MenuButton 
{
	//TEXT USED: lucida console
	//COLOR USED: #00AE21
	private Point2D pos;
	private ImageLoader img;
	
	public MenuButton(Point2D position, ImageLoader image)
	{
		pos = position;
		img = image;
	}
	//checks if the button was clicked
	public boolean clicked(Point2D loc)
	{
		return (new Rectangle((int)pos.getX(), (int)pos.getY(), img.width(), img.height())).contains(loc.getX(), loc.getY());
	}
	public void render(Graphics2D g)
	{
		g.drawImage(img.getImage(), (int)pos.getX(), (int)pos.getY(), null);
	}
}
